package cn.edu.cqupt.cyExam.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;


import cn.edu.cqupt.cyExam.myBatis.bean.User;
import cn.edu.cqupt.cyExam.myBatis.dao.UserMapper;

@Service
public class LoginService {
	@Resource
	private UserMapper userMapper;
	
	
	public int CheckAcount(String usersAccountnumber) {
		return userMapper.CheckAcount(usersAccountnumber);
	}
	
	//检查邮箱惟一
		public int CheckEmail(String usersEmail) {
			return userMapper.CheckEmail(usersEmail);
		}
		
		//添加用户
		public int InsertUsers(User users) {
			return userMapper.insertUsers(users);
		}
		
		//获得用户名
		public User getUsersAccountnumber(String usersAccountnumber) {
			return userMapper.selectUsersByUsersAccountnumber(usersAccountnumber);
		}
		//通过邮箱更改密码
		public void updatepasswordByeMail(String MailPasswordByMD5,String account) {
			userMapper.updatepasswordByeMail(MailPasswordByMD5,account);
		}
}
